package com.sywb.chuangyebao.view.fragment;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;

import com.sywb.chuangyebao.R;
import com.sywb.chuangyebao.utils.GlideUtils;

/**
 * 展示大图
 */
public class BigImageFragment extends BaseStatisticsFragment {

    ImageView image;

    String imageUrl;

    /**
     * Fragment 实例
     */
    public static BigImageFragment newInstance(Object... pramars) {
        BigImageFragment fragment = new BigImageFragment();
        fragment.setArguments(getBundle(pramars));
        return fragment;
    }

    @Override
    public int getLayoutId(Bundle bundle) {
        return R.layout.fragment_image;
    }

    @Override
    public void initView(View view, Bundle bundle) {
        super.initView(view, bundle);
        if (bundle == null) {
            imageUrl = getArguments().getString("p0");
        } else {
            imageUrl = bundle.getString("p0");
        }
        image = (ImageView) getView(R.id.iv_image);
        GlideUtils.getNormalIamgeToUrl(mActivity, imageUrl, image, R.drawable.image_def);
    }
}


